.\" generated with Ronn/v0.7.3
.\" https://github.com/rtomayko/ronn/tree/0.7.3
.
.TH "PHP\-BUILD" "1" "March 2015" "php-build " "php-build"
.
.SH "NAME"
\fBphp\-build\fR \- Builds PHP versions with their coexistence in mind\.
.
.SH "SYNOPSIS"
\fBphp\-build\fR \fB\-\-definitions\fR
.
.br
\fBphp\-build\fR [\fB\-i\fR|\fB\-\-ini\fR \fIenv\fR] \fIdefinition\fR \fIprefix\fR
.
.SH "DESCRIPTION"
\fBphp\-build\fR builds common PHP versions so, that they can be used side by side in a development environment\.
.
.P
\fBphp\-build\fR works with written \fBdefinitions\fR for each PHP version which you want to build\. These definitions typically include directives, which tell where to download the source package, which XDebug version to use (if any) or add/remove/replace specific build options\.
.
.P
To list all available definitions pass the \fB\-\-definitions\fR flag\. Definitions are looked up in \fBshare/php\-build/definitions\fR\.
.
.P
To build a definition pass it as the \fIdefinition\fR argument and the path where you want to place the compiled artifacts as \fIprefix\fR argument\.
.
.P
The \fIdefinition\fR argument either expects a definition name as listed by \fB\-\-definitions\fR, or a path to the definition file you want to use\.
.
.P
\fBImportant:\fR You \fIcannot\fR move the \fIprefix\fR folder afterwards\. All paths are written \fIabsolute\fR to all generated configs and executables!
.
.P
For example to build PHP 5\.4\.0beta2 into your \fB~/local\fR folder with development configuration:
.
.P
\fB$ php\-build \-\-ini development 5\.4\.0beta2 ~/local/5\.4\.0beta2\fR
.
.P
Here is a quick overview of what is stored where:
.
.IP "\(bu" 4
\fBbin/\fR, Contains the PHP executables\.
.
.IP "\(bu" 4
\fBbin/php\fR, The PHP Executable
.
.IP "\(bu" 4
\fBetc/php\.ini\fR
.
.IP "\(bu" 4
\fBetc/conf\.d/\fR, PHP is configured to look for additional \fB\.ini\fR files in this directory\. Place your extension\'s config files or your config overrides here\.
.
.IP "" 0
.
.SS "Definitions"
Definitions are the \fIblueprints\fR for building PHP versions\. Definitions are Shell Scripts, which call some predefined functions\. Definitions are stored in \fBshare/php\-build/definitions\fR\. \fBphp\-build\fR ships with definitions for common PHP releases starting with PHP 5\.3\. You can take a look at these to get a feel for them\.
.
.P
\fBphp\-build\fR defines utility functions for building a PHP source tarball and manipulating config files\. \fBphp\-build\fR supports \fBplugins\fR which provide additional functions for usage within definitions\. Plugins must have the extension \fB\.sh\fR and are looked up in \fBshare/plugins\.d\fR\.
.
.P
\fBphp\-build\fR ships with these plugins:
.
.IP "\(bu" 4
\fBxdebug\fR, Provides the \fBinstall_xdebug\fR \fIversion\fR and \fBinstall_xdebug_master\fR commands\. Use \fBinstall_xdebug_master\fR for building development versions of PHP and \fBinstall_xdebug\fR \fIversion\fR for building stable releases\.
.
.IP "" 0
.
.P
For more information about the definition file format see php\-build(5)\.
.
.SH "OPTIONS"
.
.TP
\fB\-\-definitions\fR
Lists all definitions, which are available to build\.
.
.TP
\fB\-i\fR \fIenv\fR, \fB\-\-ini\fR \fIenv\fR
Tells \fBphp\-build\fR to use the \fBphp\.ini\fR\-\fIenv\fR from the PHP source archive\. Typically you would use either \fBproduction\fR or \fBdevelopment\fR\. Creates an empty \fBphp\.ini\fR by default\.
.
.SH "ENVIRONMENT"
.
.IP "\(bu" 4
\fBPHP_BUILD_DEBUG\fR, set this to \fByes\fR to trigger a \fBset \-x\fR call\. This echo\'s all issued shell commands of the script\.
.
.IP "\(bu" 4
\fBPHP_BUILD_XDEBUG_ENABLE=on|off\fR (default: \fBon\fR), set to \fBoff\fR to comment out the lines which enable XDebug, in the generated \fBxdebug\.ini\fR\.
.
.IP "\(bu" 4
\fBPHP_BUILD_CONFIGURE_OPTS\fR, list of additional configure options\.
.
.IP "\(bu" 4
\fBPHP_BUILD_ZTS_ENABLE=on|off\fR (default: \fBoff\fR), enables Zend Thread Safety for builds
.
.IP "\(bu" 4
\fBPHP_BUILD_INSTALL_EXTENSION\fR see \fIEXTENSION\fR section\.
.
.IP "" 0
.
.SH "EXTENSION"
To install php extension, you have to define \fBPHP_BUILD_INSTALL_EXTENSION\fR before execute php\-build\. The following are example use cases to use this environment variable
.
.IP "\(bu" 4
\fBPHP_BUILD_INSTALL_EXTENSION="apcu=4\.0\.7 imagick=3\.1\.2"\fR install APCu version 4\.0\.7 and install imagick version 3\.1\.2
.
.IP "\(bu" 4
\fBPHP_BUILD_INSTALL_EXTENSION="uprofiler=@"\fR install uprofiler from source using master branch
.
.IP "\(bu" 4
\fBPHP_BUILD_INSTALL_EXTENSION="uprofiler=@851da15"\fR install uprofiler from source using commit sha1 \'851da15\'
.
.IP "" 0
.
.SH "COPYRIGHT"
php\-build is Copyright (C) 2011 Christoph Hochstrasser \fIhttp://christophh\.net\fR\.
